from django.conf.urls import patterns,url
from django.views import generic
from instituciones.models import Institucion
from instituciones.forms import InstitucionForm
import autocomplete_light

urlpatterns = patterns('instituciones.views',
                       
    url(r'^$', 'listar'),
    url(r'^filtrar/$', 'filtrar',name='institucion_filtrar'),
    url(r'^(?P<object_id>\d+)/$', 'ver',name = 'institucion_ver'),
    #url(r'^crear/$', 'crear_automatico'),
    url(r'^crear/$', 'crear_con_experto',name = 'crear_con_experto'),
    url(r'^(?P<object_id>\d+)/editar/$', 'editar_automatico'),
    url(r'^(?P<object_id>\d+)/eliminar/$', 'eliminar'),
    url(r'add/$', 
        autocomplete_light.CreateView.as_view(model=Institucion,form_class=InstitucionForm), 
        name='institucion_create'),
    url(r'(?P<pk>\d+)/update/$', generic.UpdateView.as_view(
        model=Institucion,form_class=InstitucionForm ), name='institucion_update'),
)